<?php $paginator = $this->Paginator; ?>
<div class="row-fluid">
    <div class="span2">
        <div>
            <p class="nav-header">Actions</p>
            <ul class="nav nav-tabs nav-stacked">                
                <li><a href="<?php echo $this->Html->url('index/'); ?>">List Stocks</a></li>
            </ul>
        </div>
    </div>
    <div class="span10">
        <form action="" class="well" id="ListForm" method="post" accept-charset="utf-8">                    
            <fieldset>
                <legend>Values of <?php echo $stock['Stock']['name']; ?></legend>                

                <div class="control-group">
                    <table class="table table-bordered table-striped">
        <!-- <table class="datagrid"> -->
                        <thead>
                            <tr>
                                <th><?php echo $paginator->sort('id', 'ID') ?></th>                  
                                <th><?php echo $paginator->sort('date', 'Date') ?></th>                    
                                <th><?php echo $paginator->sort('updated', 'Updated') ?></th>                      
                                <th><?php echo $paginator->sort('phase', 'Phase') ?></th>                        
                                <th><?php echo $paginator->sort('closing', 'Closing') ?></th>
                                <th><?php echo $paginator->sort('opening', 'Opening') ?></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                            foreach ($rows as $row) {
                                $rd_id = rand(1000000000, 9999999999);
                                echo "<tr>";
                                echo "<td>{$row['StockValues']['id']}</td>";
                                echo "<td>" . date('Y-m-d', strtotime($row['StockValues']['date'])) . "</td>";
                                echo "<td>{$row['StockValues']['updated']}</td>";
                                echo "<td>{$row['StockValues']['phase']}</td>";
                                echo "<td class=\"info\"><a>{$row['StockValues']['closing']}</a>"
                                . "<span>"
                                . "Vol.bid: {$row['StockValues']['vol_bid']}<br>"
                                . "Bid: {$row['StockValues']['bid']}<br>"
                                . "Ask: {$row['StockValues']['ask']}<br>"
                                . "Vol.ask: {$row['StockValues']['vol_ask']}<br>"
                                . "Last: {$row['StockValues']['last']}<br>"
                                . "EP: {$row['StockValues']['ep']}<br>"
                                . "+/-: {$row['StockValues']['add_sub']}<br>"
                                . "%: {$row['StockValues']['percent']}<br>"
                                . "Closing: {$row['StockValues']['closing']}<br>"
                                . "Opening: {$row['StockValues']['opening']}<br>"
                                . "High: {$row['StockValues']['high']}<br>"
                                . "Low: {$row['StockValues']['low']}<br>"
                                . "Turnover: {$row['StockValues']['turnover']}<br>"
                                . "Volume: {$row['StockValues']['volume']}"
                                . "</span>"
                                . "</td>";
                                echo "<td>{$row['StockValues']['opening']}</td>";
                                echo "</tr>";
                            }
                            ?>
                        </tbody>
                    </table>

                    <div class="pagination">
                        <ul>
                            <?php
                            echo '<li>' . $paginator->first("First") . '</li>';
                            if ($paginator->hasPrev()) {
                                echo '<li>' . $paginator->prev("Prev") . '</li>';
                            }
                            // the 'number' page buttons
                            echo $paginator->numbers(array('modulus' => 3, 'tag' => 'li', 'separator' => '', 'currentTag' => 'a', 'currentClass' => 'active'));

                            // for the 'next' button
                            if ($paginator->hasNext()) {
                                echo '<li>' . $paginator->next("Next") . '</li>';
                            }
                            // the 'last' page button
                            echo '<li>' . $paginator->last("Last") . '</li>';
                            ?>
                        </ul>
                    </div>
                </div>


            </fieldset> 
        </form>    
    </div>
</div>